<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>值的绑定</title>
</head>
<body>
    <script src='/js/vue.js'></script>
    <div id='app'>
        <!-- v-for 循环渲染 -->
        <label for="" v-for="item in hobbies">
            <!-- :value 属性绑定 v-model双向绑定将数据传到myhobbies -->
            <input type="checkbox" :value="item" v-model="myhobbies">{{item}}
        </label>

        <h2>您的选择是{{myhobbies}}</h2>

        <p>{{msg}}</p>
    </div>
    <script>
        let app = new Vue({
            el:'#app',
            data:{
                msg:'hello word',
                hobbies:['篮球','足球','乒乓球','台球'],
                myhobbies:[],
            }
        })
    </script>
</body>
</html>